package com.lys.enchantment.bow;

import net.minecraft.client.gui.screen.Screen;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentTarget;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;

import java.util.List;

public class ExplosiveArrowEnchantment extends Enchantment {

    public static final String EXPLOSIVE_ARROW_TIP_TRANSLATION_KEY = "explosive_arrow_tip_translation_key";

    public ExplosiveArrowEnchantment(Enchantment.Rarity weight, EquipmentSlot... slotTypes) {
        super(weight, EnchantmentTarget.BOW, slotTypes);
    }

    @Override
    public int getMaxLevel() {
        return 5;
    }

    public static void appendTooltip(List<Text> tooltip) {
        if (Screen.hasShiftDown()) {
            tooltip.add(Text.translatable("enchantment.moreenchantmentmod.explosive_arrow").formatted(Formatting.RED));
            tooltip.add(Text.translatable(EXPLOSIVE_ARROW_TIP_TRANSLATION_KEY).formatted(Formatting.BLUE));
        } else {
            tooltip.add(Text.translatable("tip_translation_key").formatted(Formatting.GRAY));
        }
    }
}
